package dav.mobile.garuda.components;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;

//Static class for msc function
public class Utilities {
	public static void WriteJSON(String path, String JSON) {
		//Open file and write
		try {
            BufferedWriter out = new BufferedWriter(new FileWriter(path));
            out.write(JSON);
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
	}
	
	public static String ReadJSON(String path) {
		String temp = null;
		
		try {
		//Create file handler
		FileHandle m_Handler = Gdx.files.internal(path);

		//Read line
		temp = m_Handler.readString();
		} catch (Exception e) {
			e.printStackTrace();
		}
		
		//Return 
		return temp;
	}
}
